<template>
    <div>
        <el-row style="margin-top: 20px;">
            <el-form ref="search_form" :model="search_form" label-width="80px">
                <el-col :span="4"> <el-form-item label="订单编号">
                        <el-input v-model="search_form.order_number"></el-input>
                    </el-form-item></el-col>
                <el-col :span="5">
                    <el-form-item label="活动区域">
                        <el-select v-model="search_form.region" placeholder="请选择活动区域">
                            <el-option label="区域一" value="shanghai"></el-option>
                            <el-option label="区域二" value="beijing"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="4">
                    <el-date-picker v-model="search_form.order_time" type="date" placeholder="下单时间">
                    </el-date-picker>
                </el-col>
                <el-col :span="4"> <el-button type="primary" @click="search_Bth">搜索</el-button>
                    <el-button>重置</el-button></el-col>
                <!-- <el-col :span="2"> </el-col> -->
            </el-form>
        </el-row>
        <el-row>
            <el-col>
                <div class="app-container">
                    <el-table :data="tableData" border fit highlight-current-row style="width: 100%">
                        <el-table-column prop="order_number" label="订单编号"       >
                        </el-table-column>
                        <el-table-column prop="customer_id" label="客户ID"      >
                        </el-table-column>
                        <el-table-column prop="product_id" label="产品ID"       >
                        </el-table-column>
                        <el-table-column prop="store_id" label="店家ID"     >
                        </el-table-column>
                        <el-table-column     align="center" label="下单时间">
                            <template slot-scope="{row}">
                                <span>{{ row.order_time }}</span>
                            </template>
                        </el-table-column>
                        <!-- <el-table-column prop="order_time" label="下单时间">
                        </el-table-column> -->
                        <el-table-column prop="order_amount" label="订单金额"       >
                        </el-table-column>
                        <el-table-column prop="order_status" label="订单状态"       >
                        </el-table-column>
                    </el-table>
                    <!-- <Pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
                        @pagination="getList" /> -->
                </div>
            </el-col>
        </el-row>
    </div>
</template>

<script>
import { queryIndent } from '@/api/article'
import { timestampToTime } from "@/utils"
export default {
    data() {
        return {
            page: 1,
            tableData: [],
            search_form: {}
        }
    }, computed: {
        regionalData() {
            return this.$store.state.user.regionalData;
        }
    },
    methods: {
        search_Bth() {
            console.log(this.search_form, 'search_form')
        },
        getList() {
            let params = {
                page: this.page,
                ...this.regionalData
            }
            queryIndent(params).then(res => {
                res.result.forEach(item => {
                    item.order_time = timestampToTime(item.order_time)
                });
                this.tableData = res.result
                // console.log(this.tableData, 'this.dataList')
            })
        },
    },
    mounted() {
        this.getList()
    },
}
</script>

<style></style>